package com.kindness.frate.http;

import com.kindness.frate.http.model.UserInfo;
import com.kindnesslibrary.network.retrofit.reflect.Body;
import com.kindnesslibrary.network.retrofit.reflect.FilePart;
import com.kindnesslibrary.network.retrofit.reflect.Multipart;
import com.kindnesslibrary.network.retrofit.reflect.POST;

import java.io.File;

import rx.Observable;

/**
 * Api服务
 */
public interface ApiService {

    /**
     * 登录
     * @param userInfo
     * @return
     */
    @POST(url = "ToBar/user/login")
    Observable<Response<UserInfo>> login(@Body UserInfo userInfo);

    /**
     * 上传文件，包括txt、image、pdf等
     * @param uploadFile
     * @return
     */
    @Multipart
    @POST(url = "ToBar/picture/uploadPicture")
    Observable<Response<String>> uploadFile(@FilePart("uploadFile")File uploadFile);

}
